home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
eflibpt4.zip
/
DEMO
/
STREAMS
/
CRC.PAS
next >
Wrap
Pascal/Delphi Source File
|
1996-07-31
|
1KB
|
34 lines
{ Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
Demonstration; CRC filters and file streams
EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED. }
uses EFLIBIO, EFLIBTXT;
const CRCBuffer = 4096;
var CRC : CRC16FilterObjectPointerType;
Null : NullStreamObjectPointerType;
{ ParamStr(1) must contain a filename }
begin
{ Initialize CRC filter with a file stream as base }
CRC := New (CRC16FilterObjectPointerType,
Initialize (New(FileStreamObjectPointerType,
{ Base stream }
Initialize (ParamStr(1), CRCBuffer))));
{ Filename } { Buffer size }
New (Null, Initialize);
CRC^.MoveOut (Null, CRC^.Size);
WriteLn ('The CRC16 is ', StringHexNumber(CRC^.Result), '.');
CRC^.Free; { Dispose filter including base stream }
Null^.Free; { Dispose the null stream }
end.